package sy.service.impl;

import java.io.Serializable;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.apache.log4j.Logger;

import sy.dao.PerAddressDaoI;
import sy.model.PerAddress;
import sy.model.SysUnit;
import sy.service.PerAddressServiceI;

@Service("perAddressService")
public class PerAddressServiceImpl implements PerAddressServiceI {
	
	private static final Logger logger = Logger.getLogger(PerAddress.class);
	private PerAddressDaoI perAddressDao;


	public PerAddressDaoI getPerAddressDao() {
		return perAddressDao;
	}

	@Autowired
	public void setPerAddressDao(PerAddressDaoI perAddressDao) {
		this.perAddressDao = perAddressDao;
	}

	@Override
	public Serializable save(PerAddress perAddress) {
		
		return perAddressDao.save(perAddress);
	}

	@Override
	public void remove(String[] ids) {
		// TODO Auto-generated method stub
		for (int i = 0; i < ids.length; i++) {
			PerAddress perAddress =	perAddressDao.getPerAddressById(ids[i]);
			perAddressDao.remove(perAddress);
		}
	}

	/* (non-Javadoc)
	 * @see sy.service.PerAddressServiceI#update(sy.model.PerAddress)
	 */
	@Override
	public void update(PerAddress perAddress) {
		// TODO Auto-generated method stub
		perAddressDao.update(perAddress);
	}

	/* (non-Javadoc)
	 * @see sy.service.PerAddressServiceI#list()
	 */
	@Override
	public List<PerAddress> list() {
		// TODO Auto-generated method stub
		return perAddressDao.list();
	}

	/* (non-Javadoc)
	 * @see sy.service.PerAddressServiceI#getPerAddressById(java.lang.String)
	 */
	@Override
	public PerAddress getPerAddressById(String id) {
		// TODO Auto-generated method stub
		return perAddressDao.getPerAddressById(id);
	}

	/* (non-Javadoc)
	 * @see sy.service.PerAddressServiceI#listPerAddressByKey(java.lang.String)
	 */
	@Override
	public List<PerAddress> listPerAddressByKey(String key) {
		// TODO Auto-generated method stub
		return perAddressDao.listPerAddressByKey(key);
	}



}
